package com.gaofei.miaosha;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;

/**
 * @author : gaofee
 * @date : 15:07 2021/6/1
 * @码云地址 : https://gitee.com/itgaofee
 */
@SpringBootApplication
@MapperScan("com.gaofei.miaosha.mapper")
@EnableEurekaClient
public class MiaoShaApp {

    public static void main(String[] args) {
        SpringApplication.run(MiaoShaApp.class, args);
    }


    //乐观锁需要的配置
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }
}
